/**
 * file name:		TestSwapByteBuffer.java
 * copyright:		© 2009 Kingsoft
 * author:			TanMenglong
 * version:			?.??
 * created:			2009-08-10
 * last modified:	2009-08-10
 * description:		HERE
 */

package buffer.testcase;

import buffer.SwapByteArray;
import buffer.SwapByteArray.BlockType;

/**
 * .
 * @author TanMenglong
 *
 */
public class TestSwapByteBuffer {
	public static void main(String[] args) {
		SwapByteArray buff = new SwapByteArray(4);
		try {
			buff.addBlock(BlockType.MEM);
			buff.addBlock(BlockType.DISK);
			buff.addBlock(BlockType.MEM);
			buff.addBlock(BlockType.DISK);
			for (int i = 0; i < buff.getSize(); ++i) {
				buff.write(i, i);
			}
			for (int i = 0; i < buff.getSize(); ++i) {
				System.out.println(buff.read(i));
			}
			buff.release();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
